package com.my.consumer.handler;

import com.my.common.Result;
import com.my.consumer.client.OrderClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import java.util.Random;

/**
 * @author zhaodongchao
 * @date 2020/3/9 17:27
 **/
@RestController
public class FooRestController {

    private static Logger log = LoggerFactory.getLogger(FooRestController.class);

    @Resource
    private OrderClient orderClient ;

    @GetMapping("/testf/{id}")
    public Object testFeign(@PathVariable("id") String id){
        Result result = orderClient.getOrder();
        return result ;
    }
}
